jQuery(function(){
	//if the user was logged in log out
	objUser.logout(false);

	//hide the blocker div
	jQuery('#blocker').hide();

	jQuery('#login-button').click(function(){
		//remove all errors
		jQuery('.error').removeClass("error");

		//check all inputs and set errors
		jQuery('input').each(function(){
			if(jQuery(this).val() == "") {
				jQuery(this).addClass("error");
			}
		});

		//no errors found -> login
		if(jQuery('.error').length == 0) {
			objUser.login(jQuery('#username').val(), jQuery('#password').val());
		}
	});
});